<template>
	<view>
		<view v-if="chongzhiRecord.length>0">
			<view class="order-box" v-for="(item,i) in chongzhiRecord" :key="item.index">
				<view v-if="item.prType==1">
					<view class="images1" id="zhifubao"></view> 
					<view class = "info" >
						<p class="number">{{item.prMoney}} + {{item.prPresent}} + '积分'</p> 
						<p class = "time" >{{item.prTime}}</p> 
					</view> 
					<view class = "ways " ><p style="margin-bottom:5px;">来源</p> <p > 支付宝充值 </p> </view>
				</view>
				<view v-if="item.prType==2">
					<view class="images1" id="weixin"></view> 
					<view class = "info" >
						<p class="number">{{item.prMoney}} + {{item.prPresent}} + '积分'</p> 
						<p class = "time" >{{item.prTime}}</p> 
					</view> 
					<view class = "ways " ><p style="margin-bottom:5px;">来源</p> <p>微信充值</p></view>
				</view>
				<view v-if="item.prType==3">
					<view class="images1" id="houtai"></view> 
					<view class = "info" >
						<p class="number">{{item.prMoney}} + {{item.prPresent}} + '积分'</p> 
						<p class = "time" >{{item.prTime}}</p> 
					</view> 
					<view class = "ways " ><p style="margin-bottom:5px;">来源</p> <p > 后台充值 </p> </view>
				</view>
			</view>
		</view>
		<view v-show="chongzhiRecord.length<1" class="no-chongzhi">
			<view style="width: 120px; height: auto;margin: auto;">
				<image src="../../static/center/not-records.png" style="width: 100%;height: 120px;"/>
			</view>
			<p style="text-align: center;line-height: 38px;">您还没有相关的充值记录</p>
		</view>
		<view class="tips-text">{{tips}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,				//页数
				size:10,			//条数
				chongzhiRecord:[],  //充值记录集合
				tips:"",
			}
		},
		onReachBottom() {
			if(this.tips==''){
				this.page++;
				this.getChongzhiRecord();
			}
		},
		onLoad() {
			this.getChongzhiRecord();
		},
		methods: {
			getChongzhiRecord(){
				this.$http.get('/chonzhi/fenyexcx', {
					page:this.page,
					size:this.size,
					userid:uni.getStorageSync('usersId')
				}).then(res => {
					if(res.data.length>0){
						this.chongzhiRecord=this.chongzhiRecord.concat(res.data);
					}else{
						
					}
				})
			},
		}
	}
</script>

<style>
	.tips-text{
		text-align: center;
	}
	.no-chongzhi{
		margin-top: 300rpx;
	}
</style>
